<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .con {
            display: none;
            width: 200px;
            height: 30px;
            border: black 1px solid;
            box-shadow: 5px 5px 7px rgb(224, 224, 224);
        }

        .con::before {
            content: '';
            width: 0;
            height: 0;
            position: absolute;
            top: 28px;
            left: 18px;
            border: 8px solid black;
            border-style: solid dashed dashed;
            border-color: #fff transparent transparent;
        }
    </style>
</head>

<body>
    <div class="search">
        <div class="con">123</div>
        <input type="text" placeholder="请输入你的快递单号" class="jd">
    </div>
    <script>
        var con = document.querySelector('.con')
        var ipt = document.querySelector('.jd')
        ipt.addEventListener('keyup', function (e) {
            if (this.value == '') {
                con.style.display = 'none';
            } else {

                con.innerHTML = ipt.value;
                con.style.display = 'block';
            }

        })
        ipt.addEventListener('blur', function () {
            con.style.display = 'none';
        })
        ipt.addEventListener('focus', function () {
            if (this.value !== '') {
                con.style.display = 'block';
            }
        })
    </script>
</body>

</html>